package day2.作业;

import java.util.Random;

public class Test {
public static void main(String[] args) {
    Random r = new Random();
    int sum = 1000;
    for (int i = 1; i <= 100; i++) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                int speed = r.nextInt(200)+10;
                String name=Thread.currentThread().getName();
                int s = sum;
                while (s>0){
                    try{
                        Thread.sleep(speed);
                    }catch (Exception e){}
                    s-=100;
                    System.out.println(name+"爬完100米");
                }
                System.out.println(name+"=====================到达终点=================");
            }
        },"选手"+i).start();
    }
}
}
